<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../print.css" type="text/css" media="print">
<meta content="APEngine,org.cove.ape.APEngine,damping,constraintCycles,constraintCollisionCycles,container,init,addForce,addMasslessForce,addGroup,step,paint" name="keywords">
<title>org.cove.ape.APEngine</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'APEngine - APE API Documentation';
				var baseRef = '../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">APE API Documentation</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../index-list.html')" href="../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../index.html?org/cove/ape/APEngine.html&amp;org/cove/ape/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;APEngine</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class APEngine"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">org.cove.ape</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public final  class APEngine</td>
</tr>
</table>
<p></p>
  The main engine class. 
  
  <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#constraintCollisionCycles">constraintCollisionCycles</a> : int<div class="summaryTableDescription">[static]
   
   Determines the number of times in a single <code>APEngine.step()</code> cycle that
   the constraints and particles have their positions corrected.</div>
</td><td class="summaryTableOwnerCol">APEngine</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#constraintCycles">constraintCycles</a> : int<div class="summaryTableDescription">[static]
   Determines the number of times in a single <code>APEngine.step()</code> cycle that 
   the constraints have their positions corrected.</div>
</td><td class="summaryTableOwnerCol">APEngine</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#container">container</a> : DisplayObjectContainer<div class="summaryTableDescription">[static]
   The default container used by the default painting methods of the particles and
   constraints.</div>
</td><td class="summaryTableOwnerCol">APEngine</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#damping">damping</a> : Number<div class="summaryTableDescription">[static]
   The global damping.</div>
</td><td class="summaryTableOwnerCol">APEngine</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addForce()">addForce</a>(v:<a href="Vector.html">Vector</a>):void</div>
<div class="summaryTableDescription">[static]
   Adds a force to all particles in the system.</div>
</td><td class="summaryTableOwnerCol">APEngine</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addGroup()">addGroup</a>(g:<a href="Group.html">Group</a>):void</div>
<div class="summaryTableDescription">[static]
   
   </div>
</td><td class="summaryTableOwnerCol">APEngine</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addMasslessForce()">addMasslessForce</a>(v:<a href="Vector.html">Vector</a>):void</div>
<div class="summaryTableDescription">[static]
   Adds a 'massless' force to all particles in the system.</div>
</td><td class="summaryTableOwnerCol">APEngine</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#init()">init</a>(dt:Number = 0.25):void</div>
<div class="summaryTableDescription">[static]
   Initializes the engine.</div>
</td><td class="summaryTableOwnerCol">APEngine</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#paint()">paint</a>():void</div>
<div class="summaryTableDescription">[static]
   Calling this method will in turn call each particle and constraint's paint method.</div>
</td><td class="summaryTableOwnerCol">APEngine</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#step()">step</a>():void</div>
<div class="summaryTableDescription">[static]
   The main step function of the engine.</div>
</td><td class="summaryTableOwnerCol">APEngine</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="constraintCollisionCycles"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">constraintCollisionCycles</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>constraintCollisionCycles:int</code>&nbsp;&nbsp;[read-write]<p>
   
   Determines the number of times in a single <code>APEngine.step()</code> cycle that
   the constraints and particles have their positions corrected. This can greatly increase
   stability and prevent breakthroughs, especially with large complex arrangements of 
   constraints and particles. The larger this number, the more stable the simulation,
   at an expense of performance.
      </p><p> 
   This setting differs from the <code>constraintCycles</code> property in that it
   resolves both constraints and collisions during a <code>APEngine.step()</code>. 
   The default value is 1.
   </p>
   <span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public static function get constraintCollisionCycles():int</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set constraintCollisionCycles(value:int):void</code>
<br>
</div>
<a name="constraintCycles"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">constraintCycles</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>constraintCycles:int</code>&nbsp;&nbsp;[read-write]<p>
   Determines the number of times in a single <code>APEngine.step()</code> cycle that 
   the constraints have their positions corrected. Increasing this number can result in
   stiffer, more stable configurations of constraints, especially when they are in large
   complex arrangements. The trade off is that the higher you set this number the more 
   performance will suffer.
      </p><p>
   This setting differs from the <code>constraintCollisionCycles</code> property in that it
   only resolves constraints during a <code>APEngine.step()</code>. The default value
   is 0. Because this property doesn't correct for collisions, you should only use it when
   the collisions of an arrangement of particles and constraints are not an issue. If you 
   do set this value higher than the default of 0, then  <code>constraintCollisionCycles</code>
   should at least be 1, in order to check collisions one time during the 
   <code>APEngine.step()</code> cycle.
   </p>
   
   <span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public static function get constraintCycles():int</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set constraintCycles(value:int):void</code>
<br>
</div>
<a name="container"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">container</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>container:DisplayObjectContainer</code>&nbsp;&nbsp;[read-write]<p>
   The default container used by the default painting methods of the particles and
   constraints. If you wish to use to the built in painting methods you must set 
   this first.
      </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public static function get container():DisplayObjectContainer</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set container(value:DisplayObjectContainer):void</code>
<br>
</div>
<a name="damping"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">damping</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>damping:Number</code>&nbsp;&nbsp;[read-write]<p>
   The global damping. Values should be between 0 and 1. Higher numbers
   result in less damping. A value of 1 is no damping. A value of 0 will
   not allow any particles to move. The default is 1.
   
   </p><p>
   Damping will slow down your simulation and make it more stable. If you find
   that your sim is "blowing up', try applying more damping. 
   </p>
   
   <span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public static function get damping():Number</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set damping(value:Number):void</code>
<br>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="addForce()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addForce</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public static function addForce(v:<a href="Vector.html">Vector</a>):void</code><p>
   Adds a force to all particles in the system. The mass of the particle is taken into 
   account when using this method, so it is useful for adding forces that simulate effects
   like wind. Particles with larger masses will not be affected as greatly as those with
   smaller masses. Note that the size (not to be confused with mass) of the particle has
   no effect on its physical behavior.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">v</span>:<a href="Vector.html">Vector</a></code> &mdash; A Vector represeting the force added.
   </td>
</tr>
</table>
</div>
<a name="addGroup()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addGroup</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function addGroup(g:<a href="Group.html">Group</a>):void</code><p>
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">g</span>:<a href="Group.html">Group</a></code></td>
</tr>
</table>
</div>
<a name="addMasslessForce()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addMasslessForce</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function addMasslessForce(v:<a href="Vector.html">Vector</a>):void</code><p>
   Adds a 'massless' force to all particles in the system. The mass of the particle is 
   not taken into account when using this method, so it is useful for adding forces that
   simulate effects like gravity. Particles with larger masses will be affected the same
   as those with smaller masses. Note that the size (not to be confused with mass) of 
   the particle has no effect on its physical behavior.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">v</span>:<a href="Vector.html">Vector</a></code> &mdash; A Vector represeting the force added.
   </td>
</tr>
</table>
</div>
<a name="init()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">init</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function init(dt:Number = 0.25):void</code><p>
   Initializes the engine. You must call this method prior to adding
   any particles or constraints.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">dt</span>:Number</code> (default = <code>0.25</code>)<code></code> &mdash; The delta time value for the engine. This parameter can be used -- in 
   conjunction with speed at which <code>APEngine.step()</code> is called -- to change the speed
   of the simulation. Typical values are 1/3 or 1/4. Lower values result in slower,
   but more accurate simulations, and higher ones result in faster, less accurate ones.
   Note that this only applies to the forces added to particles. If you do not add any
   forces, the <code>dt</code> value won't matter.
   </td>
</tr>
</table>
</div>
<a name="paint()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">paint</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function paint():void</code><p>
   Calling this method will in turn call each particle and constraint's paint method.
   Generally you would call this method after stepping the engine in the main program
   cycle.
   </p></div>
<a name="step()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">step</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function step():void</code><p>
   The main step function of the engine. This method should be called
   continously to advance the simulation. The faster this method is 
   called, the faster the simulation will run. Usually you would call
   this in your main program loop. 
   </p></div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright">
<footer> 
</footer>
</center>
</div>
</body>
</html>
<!-- -->
